#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<list>

using namespace std;

void Reverse(list<int>& li, int left, int right)
{
	auto front = li.begin();
	auto back = li.begin();
	
	for (int i = 0; i < right; i++)
	{
		if (i < left)
		{
			front++;
		}
		back++;
	}

	bool b = (right - left) % 2;

	if (b)
	{
		back++;
	}

	while (front != back && !b)
	{
		swap(*front, *back);
		front++;
		back--;
	}
	while (front != back && b)
	{
		back--;
		swap(*front, *back);
		front++;
	}
}

void test4()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		int tmp;
		int left, right;
		list<int> li;
		for (int i = 0; i < n; i++)
		{
			cin >> tmp;
			li.push_back(tmp);
		}
		cin >> left >> right;
		Reverse(li, left - 1, right - 1);
		for (const auto e : li)
		{
			cout << e << ' ';
		}
		cout << endl;
	}
}

int main()
{
	test4();
	return 0;
}
